<h1><%= @page_title = "Gestiones evolutivas"%></h1>

<table>
	<tr>
		<th>Alumno</th>
		<th>Fecha</th>
		<th colspan="3"></th>
	</tr>
	<%if @gestions.size == 0 then %>
		<tr><td>No hubo gestiones</td></tr>	
	<%else%>
		<%n=0%>
		<% for gestion in @gestions %>
		  <%n+=1%>
		  <tr class="row<%=n%2%>">
		  	<td><%=  link_to h(gestion.alumno.nombre_completo), :action=>'show', :controller=>'alumnos', :id=>gestion.alumno%></td>
		  	<td><%=h gestion.fecha.strftime(DATETIME_FMT)%></td>
		    <td><%=  link_to 'Detalles', :action => 'show', :id => gestion%></td>
		    <td><%=  link_to 'Editar', :action => 'edit', :id => gestion %></td>
		    <td><%=  link_to 'Eliminar', { :action => 'destroy', :id => gestion }, :confirm => 'Are you sure?', :method => :post %></td>
		  </tr>
		<% end %>
	<% end %>
</table>

<%=  (link_to '1', :page=> 1) if (@lnk_from!=1)%>
<%=  '...' if @lnk_from>2%>
<% @pn = @lnk_from %>
<% while @pn <= @lnk_to %>
	<%if @pn == @page then%>
		<%= @page%>
	<%else%>
		<%=  link_to @pn, { :page => @pn } %>
	<%end%>
	<% @pn +=1 %>
<% end %>
<%=  '...' if @lnk_to < @gestion_pages.last.number-1%>
<%=  (link_to @gestion_pages.last.number, :page=> @gestion_pages.last) if (@lnk_to!=@gestion_pages.last.number) %><br>
<br />

<%=  link_to 'New gestion', :action => 'new' %>
